<html>
<head><meta charset="utf-8"><title>Test failures with `overflow-checks = true` · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Test.20failures.20with.20.60overflow-checks.20.3D.20true.60.html">Test failures with `overflow-checks = true`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="233977266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Test%20failures%20with%20%60overflow-checks%20%3D%20true%60/near/233977266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Test.20failures.20with.20.60overflow-checks.20.3D.20true.60.html#233977266">(Apr 10 2021 at 18:41)</a>:</h4>
<p>I got some test failures (overflow check ICEs) with <code>x test src/test/ui</code> in a <em>clean</em> checkout of <a href="https://github.com/rust-lang/rust/commit/e43c2005f250b51e24d294da0b228e0a2dc4d9b2">e43c2005f250b51e24d294da0b228e0a2dc4d9b2</a>:</p>
<div class="codehilite"><pre><span></span><code>failures:

---- [ui] ui/parser/item-free-const-no-body-semantic-fail.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: &quot;/home/hyd-dev/Code/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc&quot; &quot;/home/hyd-dev/Code/rust-lang/rust/src/test/ui/parser/item-free-const-no-body-semantic-fail.rs&quot; &quot;-Zthreads=1&quot; &quot;--target=x86_64-unknown-linux-gnu&quot; &quot;--error-format&quot; &quot;json&quot; &quot;-Zui-testing&quot; &quot;-Zdeduplicate-diagnostics=no&quot; &quot;-Zemit-future-incompat-report&quot; &quot;--emit&quot; &quot;metadata&quot; &quot;-C&quot; &quot;prefer-dynamic&quot; &quot;--out-dir&quot; &quot;/home/hyd-dev/Code/rust-lang/rust/build/x86_64-unknown-linux-gnu/test/ui/parser/item-free-const-no-body-semantic-fail&quot; &quot;-A&quot; &quot;unused&quot; &quot;-Crpath&quot; &quot;-O&quot; &quot;-Cdebuginfo=0&quot; &quot;-Zunstable-options&quot; &quot;-Lnative=/home/hyd-dev/Code/rust-lang/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers&quot; &quot;-L&quot; &quot;/home/hyd-dev/Code/rust-lang/rust/build/x86_64-unknown-linux-gnu/test/ui/parser/item-free-const-no-body-semantic-fail/auxiliary&quot;
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error: free constant item without body
  --&gt; /home/hyd-dev/Code/rust-lang/rust/src/test/ui/parser/item-free-const-no-body-semantic-fail.rs:5:1
   |
LL | const A: u8; //~ ERROR free constant item without body
   | ^^^^^^^^^^^-
   |            |
   |            help: provide a definition for the constant: `= &lt;expr&gt;;`

error: free constant item without body
  --&gt; /home/hyd-dev/Code/rust-lang/rust/src/test/ui/parser/item-free-const-no-body-semantic-fail.rs:6:1
   |
LL | const B; //~ ERROR free constant item without body
   | ^^^^^^^-
   |        |
   |        help: provide a definition for the constant: `= &lt;expr&gt;;`

thread &#39;rustc&#39; panicked at &#39;attempt to subtract with overflow&#39;, /home/hyd-dev/Code/rust-lang/rust/compiler/rustc_session/src/session.rs:477:22
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: rustc_session::session::Session::track_errors
   4: rustc_typeck::check_crate
   5: rustc_interface::passes::analysis
   6: rustc_query_impl::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_query_impl::plumbing::QueryCtxt&gt; for rustc_query_impl::queries::analysis&gt;::compute
   7: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_task_impl
   8: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_eval_always_task
   9: rustc_data_structures::stack::ensure_sufficient_stack
  10: rustc_query_system::query::plumbing::force_query_with_job
  11: rustc_query_system::query::plumbing::get_query_impl
  12: rustc_query_system::query::plumbing::get_query
  13: rustc_interface::passes::QueryContext::enter
  14: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::enter
  15: rustc_span::with_source_map
  16: rustc_interface::interface::create_compiler_and_run
  17: scoped_tls::ScopedKey&lt;T&gt;::set
  18: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&amp;template=ice.md

note: rustc 1.53.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z emit-future-incompat-report -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors


------------------------------------------


---- [ui] ui/parser/item-free-static-no-body-semantic-fail.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: &quot;/home/hyd-dev/Code/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc&quot; &quot;/home/hyd-dev/Code/rust-lang/rust/src/test/ui/parser/item-free-static-no-body-semantic-fail.rs&quot; &quot;-Zthreads=1&quot; &quot;--target=x86_64-unknown-linux-gnu&quot; &quot;--error-format&quot; &quot;json&quot; &quot;-Zui-testing&quot; &quot;-Zdeduplicate-diagnostics=no&quot; &quot;-Zemit-future-incompat-report&quot; &quot;--emit&quot; &quot;metadata&quot; &quot;-C&quot; &quot;prefer-dynamic&quot; &quot;--out-dir&quot; &quot;/home/hyd-dev/Code/rust-lang/rust/build/x86_64-unknown-linux-gnu/test/ui/parser/item-free-static-no-body-semantic-fail&quot; &quot;-A&quot; &quot;unused&quot; &quot;-Crpath&quot; &quot;-O&quot; &quot;-Cdebuginfo=0&quot; &quot;-Zunstable-options&quot; &quot;-Lnative=/home/hyd-dev/Code/rust-lang/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers&quot; &quot;-L&quot; &quot;/home/hyd-dev/Code/rust-lang/rust/build/x86_64-unknown-linux-gnu/test/ui/parser/item-free-static-no-body-semantic-fail/auxiliary&quot;
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error: free static item without body
  --&gt; /home/hyd-dev/Code/rust-lang/rust/src/test/ui/parser/item-free-static-no-body-semantic-fail.rs:5:1
   |
LL | static A: u8; //~ ERROR free static item without body
   | ^^^^^^^^^^^^-
   |             |
   |             help: provide a definition for the static: `= &lt;expr&gt;;`

error: free static item without body
  --&gt; /home/hyd-dev/Code/rust-lang/rust/src/test/ui/parser/item-free-static-no-body-semantic-fail.rs:6:1
   |
LL | static B; //~ ERROR free static item without body
   | ^^^^^^^^-
   |         |
   |         help: provide a definition for the static: `= &lt;expr&gt;;`

error: free static item without body
  --&gt; /home/hyd-dev/Code/rust-lang/rust/src/test/ui/parser/item-free-static-no-body-semantic-fail.rs:8:1
   |
LL | static mut C: u8; //~ ERROR free static item without body
   | ^^^^^^^^^^^^^^^^-
   |                 |
   |                 help: provide a definition for the static: `= &lt;expr&gt;;`

error: free static item without body
  --&gt; /home/hyd-dev/Code/rust-lang/rust/src/test/ui/parser/item-free-static-no-body-semantic-fail.rs:9:1
   |
LL | static mut D; //~ ERROR free static item without body
   | ^^^^^^^^^^^^-
   |             |
   |             help: provide a definition for the static: `= &lt;expr&gt;;`

thread &#39;rustc&#39; panicked at &#39;attempt to subtract with overflow&#39;, /home/hyd-dev/Code/rust-lang/rust/compiler/rustc_session/src/session.rs:477:22
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: rustc_session::session::Session::track_errors
   4: rustc_typeck::check_crate
   5: rustc_interface::passes::analysis
   6: rustc_query_impl::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_query_impl::plumbing::QueryCtxt&gt; for rustc_query_impl::queries::analysis&gt;::compute
   7: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_task_impl
   8: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_eval_always_task
   9: rustc_data_structures::stack::ensure_sufficient_stack
  10: rustc_query_system::query::plumbing::force_query_with_job
  11: rustc_query_system::query::plumbing::get_query_impl
  12: rustc_query_system::query::plumbing::get_query
  13: rustc_interface::passes::QueryContext::enter
  14: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::enter
  15: rustc_span::with_source_map
  16: rustc_interface::interface::create_compiler_and_run
  17: scoped_tls::ScopedKey&lt;T&gt;::set
  18: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&amp;template=ice.md

note: rustc 1.53.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z emit-future-incompat-report -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors


------------------------------------------



failures:
    [ui] ui/parser/item-free-const-no-body-semantic-fail.rs
    [ui] ui/parser/item-free-static-no-body-semantic-fail.rs

test result: FAILED. 4 passed; 2 failed; 11741 ignored; 0 measured; 0 filtered out; finished in 0.69s

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
</code></pre></div>
<p>Here is my <code>config.toml</code>:</p>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="c1"># Includes one of the default files in src/bootstrap/defaults</span>
<span class="n">profile</span> <span class="o">=</span> <span class="s">"compiler"</span>
<span class="n">changelog-seen</span> <span class="o">=</span> <span class="mi">2</span>
</code></pre></div>
<p>This is my Cargo configuration:</p>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[profile.release]</span>
<span class="n">incremental</span> <span class="o">=</span> <span class="kc">false</span>
<span class="n">debug</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">debug-assertions</span> <span class="o">=</span> <span class="kc">true</span>
<span class="n">overflow-checks</span> <span class="o">=</span> <span class="kc">true</span>
<span class="n">opt-level</span> <span class="o">=</span> <span class="mi">2</span>
<span class="n">codegen-units</span> <span class="o">=</span> <span class="mi">1024</span>
<span class="n">lto</span> <span class="o">=</span> <span class="s">"off"</span>
<span class="n">panic</span> <span class="o">=</span> <span class="s">"unwind"</span>
</code></pre></div>
<p>What's going wrong? Is this a <code>rustc</code> bug that was not caught by CI?</p>



<a name="233978227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Test%20failures%20with%20%60overflow-checks%20%3D%20true%60/near/233978227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Test.20failures.20with.20.60overflow-checks.20.3D.20true.60.html#233978227">(Apr 10 2021 at 18:55)</a>:</h4>
<p><code>overflow-checks</code> is never enabled on CI.  That <em>may</em> be an oversight, though I wonder if anyone has ever considered it.  I would maybe enable them if <code>debug-assertions</code> is set, though would need to check how much that slows down the gnu-debug job.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>